﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Cofe.Core.Implements;
using Cofe.Web;

namespace Cofe.Core
{
    

    public abstract class WebAccessAttribute : Attribute
    {
        public WebAccessAttribute(MediaType outputType, WebAccessType exposeType, RelationType relationType)
        {
            WebAccessType = exposeType;
            RelationType = relationType;
        }

        public WebAccessType WebAccessType { get; protected set; }
        public RelationType RelationType { get; protected set; }
        public virtual bool SerializeAsAttribute { get { return false; } } //Return as element by default.


        /// <summary>
        /// Return if the current property is major property when the specified type is used.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public abstract bool IsMajorProperty<T>() where T : CofeSystemInfo;
        
    }
}
